import request from '@/utils/request'

// 获取品牌列表
export function getBrandList(params) {
  return request({
    url: '/waterBrand/page',
    method: 'post',
    data: params
  })
}

// 获取所有品牌（不分页）
export function getAllBrands() {
  return request({
    url: '/waterBrand/list',
    method: 'get'
  })
}

// 添加品牌
export function addBrand(data) {
  return request({
    url: '/waterBrand',
    method: 'post',
    data
  })
}

// 更新品牌
export function updateBrand(data) {
  return request({
    url: '/waterBrand',
    method: 'put',
    data
  })
}

// 删除品牌
export function deleteBrand(id) {
  return request({
    url: `/waterBrand/${id}`,
    method: 'delete'
  })
}

// 上传品牌图片
export function uploadBrandImage(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/waterBrand/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
} 